package com.briup.day15;

import java.util.LinkedList;

public class Test_Node {
    public static void main(String[] args) {
        LinkedList<String> list=new LinkedList<>();
        list.add("hello");
        list.add("world");
        list.add("nihao");
        list.addFirst("first");
        list.addLast("last");
        System.out.println(list);
        list.add(2,"baby");
        System.out.println(list);
        list.remove(2);
        System.out.println(list);
        System.out.println(list.getFirst());
        System.out.println(list.getLast());
        System.out.println(list);
        System.out.println("-------------------------");
        System.out.println(list.removeFirst());
        System.out.println(list);
        System.out.println(list.removeLast());
        System.out.println(list);
    }
}
